;; -------- garbage-collection & font caches --------

;; garbage-collection
(setq gc-cons-threshold most-positive-fixnum
      gc-cons-percentage 0.6
      file-name-handler-alist-original file-name-handler-alist)
;; when idle for 7 seconds or when Emacs is unfocused.
(run-with-idle-timer 7 t #'garbage-collect)
(add-hook 'focus-out-hook #'garbage-collect)
;; display garbage-collection-messages
;; (setq garbage-collection-messages t)

(add-hook 'after-init-hook
		  (lambda ()
            (setq gc-cons-threshold (* 1024 1024 1024)
                  file-name-handler-alist file-name-handler-alist-original)))

;; -------- via centaur.emacs --------
;; Package initialize occurs automatically, before `user-init-file' is
;; loaded, but after `early-init-file'. We handle package
;; initialization, so we must prevent Emacs from doing it early!
(setq package-enable-at-startup nil)

;; Inhibit resizing frame
(setq frame-inhibit-implied-resize t)

;; Faster to disable these here (before they've been initialized)
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(scroll-bar-mode . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
(when (featurep 'ns)
  (push '(ns-transparent-titlebar . t) default-frame-alist))

;; -------- config path --------
(add-to-list 'load-path (expand-file-name "~/.emacs.d/config"))

(require 'base)

;; Don’t compact font caches during GC.
(setq inhibit-compacting-font-caches t)
